import axios from 'axios';

const http = axios.create({
  timeout: 20000,
  maxRedirects: 0
});

http.defaults.baseURL = 'http://10.113.53.108:9003/ai/v1';


// 请求拦截器
http.interceptors.request.use(
  config => {
    const token = localStorage.getItem('token');
    if (token) {
      config.headers.Authorization = `Bearer ${token}`;
    }
    return config;
  },
  error => {
    return Promise.reject(error);
  }
);

export default http;